“array index out of bounds”指数组下标越界:程序试图访问数组中不存在的位置(例如数组长度为 5,却访问下标 5 或 -1),通常会导致运行时错误或异常(不同语言表现不同,如 Java 会抛异常,C/C++ 可能产生未定义行为)。
/əˈreɪ ˈɪnˌdɛks aʊt əv baʊndz/
The program crashed because of an array index out of bounds error.
程序因为数组下标越界错误而崩溃了。
When the loop condition used i <= length instead of i < length, it triggered an array index out of bounds exception during the last iteration.
当循环条件把 i <= length 写成了 i < length 的反面时,最后一次迭代就会触发数组下标越界异常。
该表达由三部分组成:array(数组) + index(索引/下标) + out of bounds(超出边界)。其中 bounds 表示“界限、范围”,out of bounds 原本也常用于体育或一般语境中表示“出界、越界”,在编程里引申为“访问超出合法范围的数据位置”。